<!--  -->
<template>
  <common-card title="累计订单量" :value="2.0">
    <template>
      <div id="totalOrders" :style="{ height: '100%', width: '100%' }"></div>
    </template>
    <template v-slot:footer>
      <span>昨日订单量</span>
      <span class="emphasis">0.00</span>
    </template>
  </common-card>
</template>

<script>
import commonCardMixin from '../../mixins/commonCardMixins'
// import * as echarts from 'echarts'
export default {
  mixins: [commonCardMixin],
  data() {
    return {}
  },
  mounted() {
    this.getOptions()
  },
  methods: {
    getOptions() {
      let mychart = this.$echarts.init(document.getElementById('totalOrders'))
      let option = {
        xAxis: {
          type: 'category',
          show: false,
          boundaryGap: false,
        },
        yAxis: {
          show: false,
        },
        series: [
          {
            type: 'line',
            data: ['1', '10', '5', '9'],
            areaStyle: {
              color: 'purple',
            },
            lineStyle: {
              width: 0,
            },
            itemStyle: {
              opacity: 0,
            },
            smooth: true,
          },
        ],
        grid: {
          top: 0,
          bottom: 0,
          left: 0,
          right: 0,
        },
      }
      mychart.setOption(option, true)
      window.onresize = mychart.resize
    },
  },
}
</script>
